<div class="row">
  <div class="panel panel-default">
    <div id="rulesTab" class="panel-heading panel-title" data-toggle="collapse" data-target="#rules_data">
      Rules <span class="glyphicon glyphicon-menu-down"></span>
    </div>

    <div id="rules_data" class="panel-body collapse">
      <span class="button-bar">
        <%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
        <div class="btn-group enable-bar">
          <div id="enableAllRules" class="btn btn-default">
            Enable All
          </div>
          <div id="disableAllRules" class="btn btn-default">
            Disable All
          </div>
        </div>
        <div id="ruleFilters" class="btn-group" data-toggle="buttons">
          <div class="btn btn-default active">
            <input type="checkbox" checked data-rule-type="feature"/>
              <span class="full-page" title="Feature">Feature</span>
              <span class="small-page" title="Feature">F.</span>
          </div>
          <div class="btn btn-default active">
            <input type="checkbox" checked data-rule-type="background"/>
              <span class="full-page" title="Background">Background</span>
              <span class="small-page" title="Background">B.</span>
          </div>
          <div class="btn btn-default active">
            <input type="checkbox" checked data-rule-type="scenario"/>
              <span class="full-page" title="Scenario">Scenario</span>
              <span class="small-page" title="Scenario">S.</span>
          </div>
          <div class="btn btn-default active">
            <input type="checkbox" checked data-rule-type="stepdefinition"/>
              <span class="full-page" title="Step Definition">Step Definition</span>
              <span class="small-page" title="Step Definition">S. D.</span>
          </div>
          <div class="btn btn-default active">
            <input type="checkbox" checked data-rule-type="hook"/>
              <span class="full-page" title="Hook">Hook</span>
              <span class="small-page" title="Hook">H</span>
          </div>
        </div>
      </span>
      <% cuke_sniffer.rules.each do |rule| %>
        <div class="rule" data-rule-symbol="<%=rule.symbol%>"
            <% rule.targets.each do |target| %>
                rule-<%=target%>
            <% end %>
        >
          <div>
            <input type="checkbox"
                <% if rule.enabled%>
                    checked="checked"
                <% end %>
            />
            <span data-phrase><%=rule.phrase %></span>
          </div>
          <div class="details" style="display:none;">
            <div class="well">
              <div class="row">
                <div class="col-md-3">
                  <b>Score:</b>
                </div>
                <div class="col-md-9">
                  <%= rule.score %>
                </div>
              </div>
              <div class="row">
                <div class="col-md-3">
                  <b>Targets:</b>
                </div>
                <div class="col-md-9" data-targets>
                  <%= rule.targets.to_s.gsub(/[\]\[\"]/, "") %>
                </div>
              </div>
              <% unless rule.conditions.empty? %>
                <div class="row conditions">
                  <div class="col-md-3">
                    <b>Conditions:</b>
                  </div>
                  <div class="col-md-9">
                    <% rule.conditions.each do |condition_symbol, value| %>
                      <div class="row well">
                        <div class="col-md-2">
                            <%= condition_symbol %>:
                        </div>
                        <div class="col-md-10" data-conditions>
                            <%= value %>
                        </div>
                      </div>
                    <% end %>
                  </div>
                </div>
              <% end %>
            </div>
          </div>
        </div>
      <% end %>
    </div>
  </div>
</div>
